﻿namespace NTLib.Pipe.Exceptions
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;

    /// <summary>
    /// Raised when the user try to pop, send or push without permitions.
    /// </summary>
    public class PipeActionNotPermitsException : PipeException
    {
        #region Fields

        private readonly PipeType _type;
        
        #endregion

        #region Ctor

        /// <summary>
        /// Initializes a new instance of the <see cref="PipeActionNotPermitsException"/> class.
        /// </summary>
        /// <param name="type">The type assign to the pipe.</param>
        /// <param name="action">The action you try to calle.</param>
        public PipeActionNotPermitsException(PipeType type, string action)
            : base(action)
        {
            this._type = type;
        }

        #endregion

        #region Property

        /// <summary>
        /// Gets the type of the pipe.
        /// </summary>
        public PipeType Type
        {
            get { return this._type; }
        }

        #endregion
    }
}
